package com.bsb.base.common.config;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public enum Accounting {
	ZICHAN("资产类", "1"), 
	FUZAI("负债类", "2"), 
	GONGTONG("共同类", "3"),
	CHENGBEN("成本类", "4"),
	SUNYI("损益类","5"), 
	SUOYOUZHEQUANYI("所有者权益类", "6");

	// 成员变量
	private String name;
	private String index;

	private Accounting(String name, String index) {
		this.name = name;
		this.index = index;
	}

	// 普通方法
	public static String getName(String index) {
		for (Accounting c : Accounting.values()) {
			if (c.getIndex().equals(index)) {
				return c.name;
			}
		}
		return null;
	}

	public static List<Accounting> getList() {
		List<Accounting> list = new ArrayList<Accounting>(Arrays.asList(Accounting.values()));
		return list;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIndex() {
		return index;
	}

	public void setIndex(String index) {
		this.index = index;
	}

}
